package com.ruoyi.mq.listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class MessageConsumer {


    // 消费队列1中的消息
    @RabbitListener(queues = "#{T(com.ruoyi.mq.config.QueueConfig).DESTINATION}")
    public void receiveMessageFromQueue1( String message) {
        System.out.println("Consumer 1 received: " + message);
    }

}
